package es.uji.viselab.network;

import java.net.Socket;
import java.util.List;

import es.uji.viselab.LogLevel;
import es.uji.viselab.LogRecorder;
import es.uji.viselab.ViSeLabException;

public class Client extends Network {
	
	public Client(EncoderDecoder ed) {
		super(ed);
	}

	public void connect(String ip, int port) throws ViSeLabException {
		try {
			socket = new Socket(ip, port);
			createReceiver();
			createSender();
			LogRecorder.log(LogLevel.INFO, "TCP client connected with " + ip + ":"+port);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			throw new ViSeLabException("Client cannot connect","Client.connect();") ;
		}
	}

}
